The rendering of high-quality shadows in a 3D scene is currently achieved by using ray-tracing techniques, which allow precise visibility tests between light sources and surfaces. Those tests consist in casting a ray towards light sources and determine whether or not it intersects an element of the scene. If an intersection is found, the point is considered in shadow.
The main issue with those techniques is their computing costs, all the more since computing such intersections for every pixel of the scene can become prohibitive even when using optimized GPU (Graphics Processing Unit) ray tracing engine and dedicated spatial acceleration data structures. In order to overcome this drawback while endeavouring to preserve good quality outputs, significant work dedicated to real time rendering techniques for shadows has been done.
In particular, several techniques for hybrid rendering of shadows have been developed. Such techniques are hybrid in that they are relying partly on ray-tracing, and partly on other approaches less costly in time processing, usually relying on GPU rasterization. This includes notably local intersection tests.
Such a solution has been described by S. Hertel, K. Hormann and R. Westermann in “A hybrid GPU rendering pipeline for alias-free hard shadows”, D. Ebert and J. Krüger, editors, Eurographics 2009 Areas Papers, pages 59-66, München, Germany, March/April 2009, Eurographics Association. They combine the rasterization of a shadow map with a GPU ray-tracer to accelerate the rendering of ray-traced shadows, by using conservative rasterization of the shadow map. Building a shadow map using conservative triangle rasterization means that a triangle is rasterized into each shadow map pixel or texel that is at least partly covered by that triangle's light space projection.
Also, the shadow map is used for storing a depth value, a triangle ID (identifier) and a flag indicating whether the triangle fully covers or not the considered texel. The depth value is obtained through a slope scale depth correction, by shifting the triangle towards the light source so that the depth value associated with the texel center corresponds to a minimum value found in the texel area crossed by the triangle plane. By using a simple depth test and by checking the triangle coverage flag, they are then able to quickly classify pixels that are lit or shadowed. For remaining unclassified view samples, they further perform an intersection test against the rasterized triangle by retrieving its coordinates through its ID. For still remaining pixels, classified as uncertain, they cast shadow rays using a GPU ray-tracer to solve their lit status.
That method suffers however some following drawbacks. First, it requires triangle indexing of the scene and storage of the triangles in a geometry buffer. If vertices are animated, this buffer needs to be updated and may introduce some computational overhead. Moreover, many different triangle IDs may be stored locally in a shadow map, especially in presence of unorganized geometry (trees or leaves, for instance). Storing such unorganized triangle IDs leads to scattered memory accesses that have proved to be inefficient on GPU architecture. This is suspected to be the bottleneck of their method, since the reported speed-up does not show so much improvement in rendering times. Namely, best reported speed up amounts to a factor of around 1.46 over a full ray-tracing solution. In addition, the use of the triangle coverage flag is prone to errors for inclined surfaces. Finally, that technique performs excessive ray-tracing computations in areas lying in shadow edges. Computational overhead becomes even prohibitive in presence of models with geometry density similar or slightly greater than the shadow map resolution.
Another hybrid method has been proposed by C. Lauterbach, Q. Mo and D. Manocha in “Fast Hard and Soft Shadow Generation on Complex Models using Selective Ray Tracing”, UNC CS Technical Report TR09-004, January 2009. They use also a conservative shadow map to accelerate shadow ray-tracing computations, and further propose to analyze depth for the eight surrounding texels around a considered sample so as to detect the presence of shadow edges. This is done by comparing the maximum absolute depth difference with the minimum depth variation determined by a far and near plane. Depending on a surface inclination with respect to the light source, they determine pixels that need to be ray-traced or not.
A drawback of this method is that it fails in detecting small holes in geometry due to the finite resolution of shadow map and the lack of geometric information. Moreover, it is sensitive to shadow map bias.
More recently, other technologies enabling to enhance depth map computing have been disclosed in WO 2014/124870 A1 and WO 2014/124871 A2 to Thomson Licensing (both having as inventors P. Lecocq, P. Gautron and J.-E. Marvie) published on Aug. 21, 2014. In this purpose, as usually practiced, a distance between a point of view (which can correspond to a light source) and a fragment of scene is compared with depth information associated with an element of the depth map or shadow map corresponding to a projection of that fragment into the depth map. However, the depth information is not only retrieved from merely depth data associated with the center of the element, but results also from information representing the variation of depth inside the element. This can result in more precise rendering, by correcting some defects related to the finite resolution of the depth map. Various ways for obtaining relevant variation of depth are further described. Also, it is detailed (in WO 2014/124870 A1) how to establish the frontier between objects of a scene in a depth map, using vertices of surface elements stored in depth map elements.
Though those technologies provide quite useful tools in shadow computing, it is anyway desirable to still improve computing efficiency without being prejudicial to rendering precision.